﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spring.Data.Generic;
using System.Data;

namespace Ordering
{
    public static class DishDAO
    {
        private static AdoTemplate template = AppConfigurer.AdoTemplate;

        public static IList<Dish> ListDishs(string ShopName)
        {
            string strSql = "select * from Dish where Shop_Id = 'S00000002'";
            IList<Dish> lstRet = new List<Dish>();

            template.QueryWithRowCallbackDelegate(CommandType.Text, strSql, delegate(IDataReader dr)
            {
                Dish di = new Dish();
                di.Dish_Id = dr.GetString(0);
                di.Shop_Id = dr.GetString(1);
                di.Dish_Name = dr.GetString(2);
                di.Dish_Price = 12;// dr.GetFloat(3);
                di.Dish_Desc = "asd"; dr.GetString(4);

                lstRet.Add(di);
            });
            return lstRet;
        }
    }
}
